package com.fashionista;

import java.util.Random; 
import android.app.Activity; 
import android.content.Intent; 
import android.os.Bundle; 
import android.view.View; 
import android.widget.Button;
import android.widget.ImageView; 
import android.view.Menu; 
import android.view.MenuInflater; 
import android.view.MenuItem; 
import android.view.View.OnClickListener; 


public class Fashionista extends Activity implements OnClickListener{


    private Integer [] mImageIds = { 
    		R.drawable.one,
    		R.drawable.two,
    		R.drawable.three,
    };
    private static final Random rgenerator = new Random();

    private ImageView iv;



@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    Integer q = mImageIds[rgenerator.nextInt(mImageIds.length)];

    iv = (ImageView) findViewById(R.id.imageview1);
    iv.setImageResource(q);


    View nextButton = findViewById(R.id.next_image_button);
    nextButton.setOnClickListener(this);



	Button weatherButton = (Button)findViewById(R.id.weather_button);
	weatherButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v){
                    Intent weatherIntent = new Intent(
                                    Fashionista.this,
                                    getWeather.class
                                    );
            startActivity(weatherIntent);
        }  }); }

    public void onClick(View v) {
    switch (v.getId()) {
    case R.id.next_image_button:
        Integer p = mImageIds[rgenerator.nextInt(mImageIds.length)];
    	iv.setImageResource(p);
        break;
    }

}
}